package logo.lang;

public class LogoVal {

    public static final LogoVal DEFAULT = new LogoVal();

    public static final LogoBool TRUE = new LogoBool(true);

    public static final LogoBool FALSE = new LogoBool(false);

    /** Generic Logo Values may not be created except for internal use */
    protected LogoVal() {}

    public boolean isBool() {
	return false;
    }

    public boolean isNum() {
	return false;
    }

    public boolean isInt() {
	return false;
    }

    public boolean isDouble() {
	return false;
    }

    public boolean isString() {
	return false;
    }

    public boolean isSymbol() {
	return false;
    }

    public int intValue() throws LogoWrongTypeException {
	throw new LogoWrongTypeException("Integer", "No Value");
    }

    public double doubleValue() throws LogoWrongTypeException {
	throw new LogoWrongTypeException("Double", "No Value");
    }

    public LogoNum numValue() throws LogoWrongTypeException {
	throw new LogoWrongTypeException("Number", "No Value");
    }

    public boolean isTrue() {
	return false;
    }

    public boolean isFalse() {
	return false;
    }

    public LogoBool eq(LogoVal v2) throws LogoException {
	if ((this == v2) ||
	    (isTrue() && v2.isTrue()) ||
	    (isFalse() && v2.isFalse()))
	    return TRUE;
	else
	    return FALSE;
    }
}
